package com.ymtms.settlement.dao;

import com.ymtms.settlement.pojo.GoodsbillMaster;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsbillMasterMapper {
    /**
     * @description: 查询GoodsbillMaster表中已运单结算的项目（由PageHelper实现分页）
     * @return: 返回结果包含的集合
     * @author: 邱斌雨
     * @date: 2019/10/25
     */
    List<GoodsbillMaster> selectByIfSettleAccounts(
            @Param("goodsbill") GoodsbillMaster goodsbillMaster,
            @Param("startTime")String startTime, @Param("endTime")String endTime);

    GoodsbillMaster selectByGmid(Integer gmid);

    int updateIfSettleAccountsByGmid(Integer gmid);

    // 可改改变项
    List<GoodsbillMaster> selectChangeAbleGmb(@Param("goodsbill")GoodsbillMaster goodsbillMaster);
    // 详情查询
    GoodsbillMaster selectChanegAbleGbmByGmid(Integer gmid);
    // 取消代收货款业务
    int updateSetCancelCollectionBusinessByGmid(Integer gmid);
    // 添加代收货款业务
    int updateSetAddCollectionBusinessByGmid(GoodsbillMaster goodsbillMaster);
    // 修改代收业务信息
    int updateSetEditCollectionBusinessByGmid(GoodsbillMaster goodsbillMaster);

    /**
     * @description: 查询GoodsbillMaster表中已运单结算的项目（由PageHelper实现分页）
     * @return: 返回结果包含的集合
     * @author: 张泓
     * @date: 2019/10/25
     */
    List<GoodsbillMaster> selectByIfSettle(
            @Param("goodsbill") GoodsbillMaster goodsbillMaster,
            @Param("startTime") String startTime,
            @Param("endTime") String endTime);

    // 根据id查找货运单
    GoodsbillMaster selectOneByGmid(Integer gmid);


    int deleteByPrimaryKey(Integer gmid);

    int insert(GoodsbillMaster record);

    int insertSelective(GoodsbillMaster record);

    GoodsbillMaster selectByPrimaryKey(Integer gmid);

    int updateByPrimaryKeySelective(GoodsbillMaster record);

    int updateByPrimaryKey(GoodsbillMaster record);

    List<GoodsbillMaster> selectByState(String state, Integer start, Integer end);

    int selectCount(String state);

    int updateState(Integer gmid);
}